#ifndef MONITOR_FIRST_H_
#define MONITOR_FIRST_H_
#include <gtkmm/button.h>
#include <gtkmm/entry.h>
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include <iostream>
#include "monitor_account_manager.h"
#include "monitor_cfg_manager.h"
#include "monitor_graphic.h"
class First: public Gtk::Window {
public:
	First(Monitor* m) :
			image("./monitor.jpg"), accounts_button("Account manager"), cfg_button(
					"Edit cfg"), statistics_button("Statistics"), box(true, 60) {
		this->m = m;
		set_modal(true);
		set_size_request(400, 400);
		set_title("Monitor Application");
		set_border_width(10);
		accounts_button.signal_clicked().connect(
				sigc::mem_fun(*this, &First::on_accounts_clicked));
		cfg_button.signal_clicked().connect(
				sigc::mem_fun(*this, &First::on_cfg_clicked));
		statistics_button.signal_clicked().connect(
				sigc::mem_fun(*this, &First::on_statistics_clicked));
		add(box);
		box.pack_start(*Gtk::manage(&image));
		box.pack_start(accounts_button);
		box.pack_start(cfg_button);
		box.pack_start(statistics_button);
		accounts_button.show();
		cfg_button.show();
		statistics_button.show();
		box.show();
		show_all_children();
	}
protected:
	void on_accounts_clicked() {
		AccountManager a(m);
		Gtk::Main::run(a);
	}
	void on_cfg_clicked() {
		CfgManager c(m);
		Gtk::Main::run(c);
	}
	void on_statistics_clicked() {
		string path("./points.txt");
		Gtk::Window win;
		win.set_title("Stored data graphic ");
		Graphic area(500, 500, &path);
		win.add(area);
		win.set_modal(true);
		area.show();
		Gtk::Main::run(win);
	}

private:
	Gtk::VBox box;
	Gtk::Image image;
	Gtk::Button accounts_button, cfg_button, statistics_button;
	Monitor* m;
};

#endif /* MONITOR_FIRST_H_ */
